package com.bruce.demo2.patterns.demo2.structural.demo12.flyweight.demo2;

/**
 * @PROJECT_NAME: design_patterns
 * @DESCRIPTION: 测试类
 * @AUTHOR: CNBruceLee
 * @DATE: 2021/8/2 23:03
 */
public class Test {
    @org.junit.Test
    public void test() {
        ITank t70 = TankFactory.getInstance().getTank("T70");
        ITank t901 = TankFactory.getInstance().getTank("T90");
        ITank t902 = TankFactory.getInstance().getTank("T90");

        System.out.println("===============t70============");
        t70.operation("向前");
        System.out.println("===============t90-1============");
        t901.operation("向后");
        System.out.println("===============t90-2============");
        t902.operation("向左");
        System.out.println(t901 == t902);
    }
}
